package com.jacquesh.state;

import org.apache.flink.api.java.io.TextInputFormat;
import org.apache.flink.core.fs.Path;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.source.FileProcessingMode;

public class KeyedStateDemo {
    public static void main(String[] args) throws Exception {
        String  filePath = "data/data.txt";
        StreamExecutionEnvironment environment =
                StreamExecutionEnvironment.getExecutionEnvironment();
         DataStream<String> stream =environment.readFile (
                new TextInputFormat(new Path(filePath)),
                filePath,
                 FileProcessingMode.PROCESS_CONTINUOUSLY,
                10);
        stream.print();
        environment.execute("");
    }
}
